package action;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;
import javax.swing.JCheckBox;

import data_generator.entity.SensorNode;

public class NodeSelectAction extends AbstractAction {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private SensorNode sn;

	public NodeSelectAction(SensorNode sn) {
		super();
		this.sn = sn;
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		JCheckBox checkBox = (JCheckBox) e.getSource();

		sn.setShow(checkBox.isSelected());
		System.out.println(sn.getName() + " " + sn.isShow());

	}

}
